package com.smart.lx.factory.simple;

import com.smart.lx.factory.Car;
import com.smart.lx.factory.DazhongCar;
import com.smart.lx.factory.FuteCar;
import com.smart.lx.factory.JiliCar;

/**
 * 功能描述: <br>
 * 〈简单工厂〉
 * <p>
 * 工厂
 *
 * @since: 1.0.0
 * @Author:abc
 * @Date: 2019/3/9
 */
public class SimpleFactory {

    public Car getCar(String name){
        if("福特".equals(name)){
            System.out.println("福特汽车");
            return new FuteCar();
        }else if("吉利".equals(name)){
            System.out.println("吉利汽车");
            return new JiliCar();
        }else if("大众".equals(name)){
            System.out.println("大众汽车");
            return new DazhongCar();
        }else {
            System.out.println("不能生产");
            return null;
        }
    }

}
